<template>
	<view>
		<input v-model="newNickName" :focus="true" class="input" :placeholder="oldNickName" type="text" />
		<view class="nick-emit" @tap="saveNickName">保存</view>
	</view>
</template>

<script>
import Route from '@/utils/Route.js';
import Tools from '@/utils/Tools.js';
export default {
	data() {
		return {
			oldNickName: '',
			newNickName: ''
		};
	},
	onLoad(options) {
		this.oldNickName = options.nickName;
	},
	methods: {
		saveNickName() {
			uni.$emit('setNickName', { nickName: this.newNickName });
			Route.navigateBack();
		}
	}
};
</script>

<style>
.input {
	margin-top: 20rpx;
	height: 100rpx;
	background: #fff;
	padding: 0 20rpx;
}
.nick-emit {
	height: 90rpx;
	background: #fd4a5f;
	margin: 50rpx 40rpx 0;
	border-radius: 12rpx;
	color: #fff;
	display: flex;
	justify-content: center;
	align-items: center;
}
</style>
